package TestDemo3;


public class Test {
    public static void test(Animal animal){
        animal.eat();
    }

    public static void test1(IFiying iFiying){
        iFiying.fly();
    }

    public static void test2(IRunning iRunning){
        iRunning.run();
    }

    public static void test3(ISwimming iSwimming){
        iSwimming.swim();
    }
    public static void main(String[] args) {
        Dog dog = new Dog("小狗",1);
        Bird bird = new Bird("小鸟",2);

        test(dog);
        test(bird);
        System.out.println("================");
        test1(bird);
        System.out.println("================");
        test2(dog);
        test2(bird);
        System.out.println("================");
        test3(dog);
    }
}
